package com.sugar.real.estate.module.business.controller.app.infocls;

import com.sugar.real.estate.framework.common.pojo.CommonResult;
import com.sugar.real.estate.module.business.controller.admin.infocls.vo.InfoClsSimpleRespVO;
import com.sugar.real.estate.module.business.service.infocls.InfoClsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
import java.util.List;

import static com.sugar.real.estate.framework.common.pojo.CommonResult.success;

@Tag(name = "APP - 资讯分类")
@RestController
@RequestMapping("/biz/info-cls")
@Validated
public class AppInfoClsController {

    @Resource
    private InfoClsService infoClsService;

    @GetMapping("/all")
    @Operation(summary = "获得全部分类")
    @PermitAll
    public CommonResult<List<InfoClsSimpleRespVO>> getInfoClsAll() {
        return success(infoClsService.appGetInfoClsAll());
    }
}